<template>
  <div class="test">
    <h2 class="n">学生名称：{{ name }}</h2>
    <h2>学生性别：{{ sex }}</h2>
    <button @click="sendStudentName">把学生名给School</button>
  </div>
</template>

<script>
import pubsub from "pubsub-js";

export default {
  name: "StudentStudent",
  data() {
    return {
      name: "SONG",
      sex: "male",
    };
  },
  mounted() {

  },
  methods: {
    sendStudentName() {
      pubsub.publish('hello',"hello_data")
    },
  },
};
</script>

<style lang="less">
.test {
  background-color: antiquewhite;
  .n {
    font-size: 40px;
  }
}
</style>

